package com.nvwa.mvp.abase.printbeans;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
@ConditionalOnProperty(prefix = PrintBeansProperties.PREFIX, name = "enabled", havingValue = "true")
@EnableConfigurationProperties(PrintBeansProperties.class)
public class PrintBeansConfig {
    public PrintBeansConfig() {
    }

    @Bean
    public PrintBeansCommandLineRunner printBeans(PrintBeansProperties printBeansProperties) {
        log.info("--- PrintBeansCommandLineRunner Bean 初始化---");
        return new PrintBeansCommandLineRunner(printBeansProperties);
    }
}
